﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace RPGMapa.Data
{
    [Serializable()]
    public class StringMatrix
    {
        private string[,] data;

        public string[,] Data
        {
            get { return data; }
        }
        private int height, width;

        public int Width
        {
            get { return width; }
        }

        public int Height
        {
            get { return height; }
        }
        public StringMatrix(int w, int h)
        {
            width = w; height = h;
            data = new string[w, h];
            data.Initialize();
        }

        public string this[int x, int y]
        {
            get { return data[x, y]; }
            set { data[x, y] = value; }
        }

        public override string ToString()
        {
            StringBuilder sb = new StringBuilder();
            for (int j = 0; j < height; j++)
            {
                for (int i = 0; i < width; i++)
                {
                    if (data[i, j] == "False")
                    {
                        sb.Append("0" + '@');
                    }
                    else
                    {
                        sb.Append("1" + '@');
                    }
                }
            }
            return sb.ToString();
        }
    }
}
